/// @tags: TCP by length DP on Tree
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <iostream>
#define rint register int

using std::cin;
using std::cout;

namespace BlueQuantum {

constexpr int maxn = 1e6 + 3;
constexpr double eps = 1e-5, inf = 1e18;

int heads[maxn];
int sonw[maxn], dep[maxn], son[maxn], dfn[maxn], n, L, R, dcnt;
double offset, f[maxn], tr[maxn], ans, g[maxn];

struct Edge {
  int v, nxt, w;
} e[maxn * 2];

inline void add(int u, int v, int w) {
  static int ecnt;
  e[++ecnt].v = v, e[ecnt].nxt = heads[u], heads[u] = ecnt, e[ecnt].w = w;
}

void clear(int u, int l, int r) {
  tr[u] = -inf;
  if (l == r) return;
  int mid = (l + r) >> 1;
  clear(u << 1, l, mid);
  clear(u << 1 | 1, mid + 1, r);
}

void modify(int u, int l, int r, int dfn, double val) {
  tr[u] = std::max(tr[u], val);
  if (l == r) {
    return;
  }
  int mid = (l + r) >> 1;
  if (dfn <= mid)
    modify(u << 1, l, mid, dfn, val);
  else
    modify(u << 1 | 1, mid + 1, r, dfn, val);
}

double query(int u, int l, int r, int L, int R) {
  if (l > R || r < L) return -inf;
  if (l >= L && r <= R) return tr[u];
  int mid = (l + r) >> 1;
  return std::max(query(u << 1, l, mid, L, R), query(u << 1 | 1, mid + 1, r, L, R));
}

void dfs(int u, int fa) {
  dep[u] = -1;
  for (int i = heads[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v != fa) {
      dfs(v, u);
      if (dep[u] < dep[v]) dep[u] = dep[v], son[u] = v, sonw[u] = e[i].w;
    }
  }
  dep[u]++;
}

void solve(int fa, int u) {
  if (!dfn[u]) dfn[u] = ++dcnt;
  int du = dfn[u];
  g[du] = f[du] = 0;
  if (son[u]) {
    solve(u, son[u]);
    g[du] = g[du + 1] + sonw[u] - offset;
    f[du] = -g[du];
  }
  modify(1, 1, n, du, f[du]);
  for (int i = heads[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == fa || v == son[u]) continue;
    solve(u, v);
    int pv = dfn[v];
    for (int j = 1; j <= dep[v] + 1; ++j)
      if (L - j <= dep[u]) {
        double xx = query(1, 1, n, du + std::max(1, L - j), du + std::min(R - j, dep[u]));
        ans = std::max(ans, e[i].w - offset + f[pv + j - 1] + g[pv] + g[du] + xx);
      }
    for (int j = 1; j <= dep[v] + 1; ++j) {
      if (e[i].w - offset + f[pv + j - 1] + g[pv] > g[du] + f[du + j]) {
        f[du + j] = e[i].w - offset + f[pv + j - 1] + g[pv] - g[du];
        modify(1, 1, n, du + j, f[du + j]);
      }
    }
  }
  if (dep[u] >= L) ans = std::max(ans, g[du] + query(1, 1, n, du + L, du + std::min(R, dep[u])));
}

inline int check(double x) {
  clear(1, 1, n);
  offset = x;
  ans = -inf;
  solve(0, 1);
  return ans >= 0;
}

inline int main() {
  cin >> n >> L >> R;
  for (int i = 1; i < n; ++i) {
    int u, v, w;
    cin >> u >> v >> w;
    add(u, v, w);
    add(v, u, w);
  }
  dfs(1, 1);
  double l = 0, r = 1e6;
  while (r - l > eps) {
    double mid = (l + r) / 2;
    check(mid) ? l = mid : r = mid;
  }
  cout << std::fixed << std::setprecision(3) << l;
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("P4292 [WC2010] 重建计划.in", "r", stdin);
  freopen("P4292 [WC2010] 重建计划.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
